package com.study.modules.sys.model.dto;

import com.study.common.validate.Update;
import com.study.modules.sys.model.entity.SysRole;
import lombok.Data;

import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.util.Date;
import java.util.List;

/**
 * @Author Mr.Du
 * @Date 2021/10/21 8:32
 */
@Data
public class SysUserDTO {
    @Valid
    @NotNull(message = "用户id不能为空",groups = Update.class)
    @NotBlank(message = "用户id不能为空",groups = Update.class)
    private Long id;
    @Valid
    @NotNull(message = "用户名不能为空",groups = Update.class)
    @NotBlank(message = "用户名不能为空！")
    private String loginName;
    @Valid
    @Size(message = "密码必须大于4位，小于10位！",max = 10 , min = 4)
    @NotBlank(message = "密码不能为空！")
    private String password;
    private String salt;
    @Valid
    @NotBlank(message = "名字不能为空！")
    private String realName;
    private Integer userType = 1;
    private Integer status;
    private Integer deleted;
    private Long createId;
    private Date createTime;
    private Long updateId;
    private Date updateTime;
    //查询时使用角色列表
    private List<SysRole> roleList;
    //新增用户使用 角色id列表 用,隔开id传入
    private String roleIdList;
}
